﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.ComponentModel;
using RATSharp.Rest;
using System.Threading.Tasks;
using RATSharp.Model;
using System.Runtime.Serialization;
namespace RATSharpW7.ViewModel
{
    /// <summary>
    /// ViewModel for objectBlorser. It's quite the same as 
    /// FavouritesViewModel, but it has abitity to load objects
    /// via search strings and QR code
    /// </summary>
    [DataContract]
    public class ObjectBrowserViewModel : FavouritesViewModel
    {
        public void loadQR(string objectIdentifier)
        {
           Task<Objects> task = RestService.getInstance().getObjectByIdentifierAsync(objectIdentifier);
           notifyChangeModel(task);
        }

        public void loadSearchable(SearchBy searchBy, string searchedText)
        {
            Task<Objects> task = RestService.getInstance().seachObjects(searchedText,searchBy);
            notifyChangeModel(task);
        }
    }
}
